package com.ds.lens.data.service.metric;

import com.ds.lens.data.common.client.vo.LensMetricInVO;
import com.ds.lens.data.common.query.MQLVariable;
import com.ds.lens.data.vo.out.v2.integration.LensIntegrationDetailOutVO;
import com.ds.lens.data.vo.out.v2.metric.LensMetricNamesOutVO;
import com.ds.lens.data.vo.out.v2.monitor.LensMonitorFilterOutVO;

import java.util.List;
import java.util.Map;

/**
 * Description:
 *
 * @author WeiShaoying
 * @date 2019-12-24
 */
public interface MetricQueryService {

    /**
     * Query metrics
     *
     * @param lensMetricInVO
     * @param integrationDetailOutVO
     * @param mqlVariables
     * @return
     */
    List<Map<String, Object>> query(LensMetricInVO lensMetricInVO, LensIntegrationDetailOutVO integrationDetailOutVO, MQLVariable... mqlVariables);

    /**
     * Get group by fields
     *
     * @param integrationDetailOutVO
     * @param applicationId
     * @param metricName
     * @return
     */
    List<String> getGroupByFields(LensIntegrationDetailOutVO integrationDetailOutVO, Long applicationId, String metricName);

    /**
     * Get metric names
     *
     * @param integrationDetailOutVO
     * @param applicationId
     * @return
     */
    List<LensMetricNamesOutVO> getMetricNames(LensIntegrationDetailOutVO integrationDetailOutVO, long applicationId);

    /**
     * Get filters
     *
     * @param integrationDetailOutVO
     * @param applicationId
     * @param tierId
     * @param metricName
     * @return
     */
    List<LensMonitorFilterOutVO> getFilters(LensIntegrationDetailOutVO integrationDetailOutVO, Long applicationId, String tierId, String metricName);


}
